package com.common.utils;

import org.springframework.stereotype.Component;

@Component
public class Canca {

    private static ThreadLocal<Long> threadLocal=new ThreadLocal<>();

    private Canca(){

    }

    public static Long getUserId(){
       return threadLocal.get();
    }

    public static void remove(){
        threadLocal.remove();
    }

    public static void setId(long userId){
        threadLocal.set(userId);
    }
}
